package com.guigu.pd.base.service.impl;

import com.guigu.pd.serviceapi.pojo.TruckLicenseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.common.utils.PageUtils;
import com.guigu.common.utils.Query;

import com.guigu.pd.base.dao.TruckDriverLicenseDao;
import com.guigu.pd.base.entity.TruckDriverLicenseEntity;
import com.guigu.pd.base.service.TruckDriverLicenseService;


@Service("truckDriverLicenseService")
public class TruckDriverLicenseServiceImpl extends ServiceImpl<TruckDriverLicenseDao, TruckDriverLicenseEntity> implements TruckDriverLicenseService {


    @Autowired
    TruckDriverLicenseService truckDriverLicenseService;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TruckDriverLicenseEntity> page = this.page(
                new Query<TruckDriverLicenseEntity>().getPage(params),
                new QueryWrapper<TruckDriverLicenseEntity>()
        );

        return new PageUtils(page);
    }

    public TruckDriverLicenseEntity getcarInfobyId(String id) {
        QueryWrapper<TruckDriverLicenseEntity> queryWrapper = new QueryWrapper<TruckDriverLicenseEntity>();
        queryWrapper.eq("user_id",id);
        TruckDriverLicenseEntity truckDriverLicense = truckDriverLicenseService.getOne(queryWrapper);

        return truckDriverLicense;
    }
}
